package ch5.ext;

import ch5.oop.ch4.Penguin;

public class Zoo {
	private String name;

	public Zoo(String n) {
		this.name = n;
	}

	// 买宠物
	public Pet sell(int money) {
		if (money > 500000) {
			return new Tiger("大花猫", 80, 80, "东北虎");
		} else if (money > 300000) {
			return new ch5.oop.ch3.Penguin();
		} else if (money > 10000) {
			return new Dog("大黄", 60, 60, "哈士奇");
		} else if (money > 100) {
			return new GoldFish("小红", 78, 80, "鲤鱼");
		}
		return null;
	}

	public static void main(String[] args) {
		Zoo z = new Zoo("合肥市野生动物园");
		Pet p = z.sell(2300000);
		if (p == null) {
			System.out.println("钱不够，什么没买到");
		} else {
			System.out.println("买到了：");
			System.out.println(p);
		}
	}
}
